<?php
session_start();
require('class/auth.php');
require_once('recaptchalib.php');
include_once('class/autoload.php'); // pour inclure nos classes

if(Auth::islog()){
}else{
	header('Location:index.php');
}
global $connexion;

$id_appart=$_GET['id_appart'];
echo $id_appart;

$a = array('id_appart'=>$id_appart);
$requete1 = "Delete FROM appartement WHERE idAppart = :id_appart ";
$req1 = $connexion->prepare($requete1);
$req1->execute($a);

$b = array('id_appart'=>$id_appart);
$requete2 = "Delete FROM image WHERE idAppart = :id_appart ";
$req2 = $connexion->prepare($requete2);
$req2->execute($b);

$c = array('id_appart'=>$id_appart);
$requete3 = "Delete FROM locataires   WHERE idAppart = :id_appart ";
$req3 = $connexion->prepare($requete3);
$req3->execute($c);

header('Location:appartementeleve.php');